\chapter{\espresso interface}
\label{sec:usage:espresso}
\textbf{WARNING: The \espresso interface only supports the Iterative Boltzmann
  Inversion scheme. It does not support Inverse Monte Carlo or Force Matching.}

\section{Running \ibi with \espresso}

While \espresso\cite{Limbach:2006} is not capable of simulating atomistic
systems, it is possible to coarse-grain molecules from existing radial
distribution functions. In addition to the target RDFs, the user needs to
provide two files:
\begin{itemize}
\item Blockfile
\item XML settings file
\end{itemize}

The blockfile\footnote{For more information on \espresso blockfiles, see the
  \espresso user guide.} contains all the initial \espresso parameters to
start the first simulation step: time step, box size, temperature, friction
coefficient of the thermostat, verlet skin, etc. It also includes the initial
positions, velocities, particle types, masses, molecule IDs of all the
particles. Including velocities is important to start at the correct
temperature. Topology can be specified by including the bond descriptions
between particles. Interactions need also to be present, as well as the
thermostat itself. In this respect, the blockfile contains all the necessary
information required to directly start the simulation: from \espresso variable
to initial structure to topology to interactions. An example blockfile can
easily be created by the following commands
\begin{verbatim}
  set out [open "| gzip -c - > conf.esp.gz" w]
  blockfile $out write variable all
  blockfile $out write particles [list id type molecule mass pos v]
  blockfile $out write interactions
  blockfile $out write thermostat
  blockfile $out write tclvariable [list list1]
  close $out
\end{verbatim}
where the first line opens the file for output (to a gzipped file), and the
blockfile is generated by appending information blocks. The next to last line
contains a special TCL variable that contains the list of particles to be
taken into account during the RDF calculation. The blockfile itself can be
ordered in any way and can contain as much information as the user
needs. The script above represents the minimal amount of information that has
to be supplied to \votca. For examples on generated blockfiles and on scripts
to generate such blockfiles, see the Tutorials package:
\begin{verbatim}
tutorials/methanol/ibm_espresso/conf.esp.gz
tutorials/methanol/ibm_espresso/generate_esp_from_gro/
tutorials/propane/ibm_espresso/conf.esp.gz
tutorials/propane/ibm_espresso/generate_esp_from_gro/
\end{verbatim}

The XML settings file contains several pieces of information specific to
\espresso (entries that are common with \gromacs are not described here):
\begin{description}
\item[<cg><non-bonded><inverse><espresso><index1>] provides the name of the
  TCL variable containing the list of type1 particle IDs involved in the
  type1-type2 RDF calculation
\item[<cg><non-bonded><inverse><espresso><index2>] same as previously for the
  list of type2 particle IDs.
\item[<cg><inverse><program>] should be ``espresso''.
\item[<cg><inverse><espresso>] :
  \begin{description}
  \item[<bin>] the name or path of the executable (\emph{e.g.} Espresso\_bin)
  \item[<equi\_snapshots>] trash so many snapshots before analyzing the data
  \item[<table\_bins>] bin size for table
  \item[<table\_end>] distance cutoff
  \item[<blockfile>] input blockfile containing all simulation parameters
    (gzipped format)
  \item[<n\_steps>] number of MD steps to integrate between each snapshot
  \item[<n\_snapshots>] number of snaphsots before RDF calculation
  \end{description}
\end{description}
See the Tutorials package for XML settings file examples:
\begin{verbatim}
tutorials/methanol/ibm_espresso/settings.xml
tutorials/propane/ibm_espresso/settings.xml
\end{verbatim}



